package com.bilibili.juc.locks_2.demo_eight;


import java.util.concurrent.TimeUnit;

/**
 * 1 标准访问有ab两个线程，请问先打印邮件还是短信
 *
 * @author 陈賝
 * @since 2024/5/28 15:23
 */
public class demo_1 {
    public static void main(String[] args) throws InterruptedException//一切程序的入口
    {
        Phone phone = new Phone();

        new Thread(phone::sendEmail, "a").start();

        //暂停毫秒,保证a线程先启动
        TimeUnit.MILLISECONDS.sleep(100);

        new Thread(() -> {
            phone.sendSMS();
        }, "b").start();
    }
}
//-----sendEmail
//-----sendSMS
